#pragma once

class CUserSearchDlg : public CDialogImpl<CUserSearchDlg>, public CWinDataExchange<CUserSearchDlg>
{
public:
	enum { IDD = IDD_DIALOG_SEARCH_USER };

	BEGIN_MSG_MAP(CUserSearchDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(IDOK, OnOK)
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_HANDLER(IDC_BUTTON_SEARCH, BN_CLICKED, OnBnClickedButtonSearch)
        NOTIFY_HANDLER(IDC_LIST_USER, NM_DBLCLK, OnNMDblclkListUser)
    END_MSG_MAP()


	BEGIN_DDX_MAP(CUserSearchDlg)
		DDX_TEXT(IDC_EDIT_ID, m_strId)
		DDX_TEXT(IDC_EDIT_NAME, m_strName )
		DDX_TEXT(IDC_EDIT_NATIVE_PLACE, m_strNativePlace)
		DDX_TEXT(IDC_EDIT_NATHIONALITY, m_strNationality)
		DDX_TEXT(IDC_EDIT_MAIL, m_strMail)
		DDX_TEXT(IDC_EDIT_MOBILE, m_strMobile)
		DDX_TEXT(IDC_EDIT_PHONE, m_strPhone)
        DDX_CONTROL_HANDLE(IDC_LIST_USER, m_lcUserInfo)
	END_DDX_MAP()


	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

public:
    CString             m_strId;
protected:
	CString             m_strName;
	CString             m_strNativePlace;
	CString             m_strNationality;
	CString             m_strMail;
	CString             m_strMobile;
	CString             m_strPhone;
	CString             m_strManIncident;
	CString             m_strManRelatioin;
	CString             m_strManPhone;

	CListViewCtrl		m_lcUserInfo;

public:
	LRESULT OnBnClickedButtonSearch(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnBnClickedOk(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnNMDblclkListUser(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
};


